delete from dbo.stdtabelasvar where tabela = 'TDU_FolhaObra';
delete from dbo.stdcamposvar where tabela = 'TDU_FolhaObra';
insert into dbo.stdtabelasvar values('TDU_FolhaObra', 'ERP');
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_Id', 'Id', 'Id', 1, 1, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_DataRecepcao', 'DataRecepcao', 'DataRecepcao', 1, 2, NULL, null, NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_DataEntrega', 'DataEntrega', 'DataEntrega', 1, 3, NULL, null, NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_Ano', 'Ano', 'Ano', 1, 4, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_Numero', 'Numero', 'Numero', 1, 5, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_Nome', 'Nome', 'Nome', 1, 6, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_MatriculaVeiculo', 'MatriculaVeiculo', 'MatriculaVeiculo', 1, 7, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_KmsVeiculo', 'KmsVeiculo', 'KmsVeiculo', 1, 8, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_IdCliente', 'IdCliente', 'IdCliente', 1, 9, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_NomeCliente', 'NomeCliente', 'NomeCliente', 1, 10, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_Valor', 'Valor', 'Valor', 1, 11, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_ValorDesconto', 'ValorDesconto', 'ValorDesconto', 1, 12, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_ValorSemIva', 'ValorSemIva', 'ValorSemIva', 1, 13, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_ValorIva', 'ValorIva', 'ValorIva', 1, 14, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_ValorComIva', 'ValorComIva', 'ValorComIva', 1, 15, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_Estado', 'Estado', 'Estado', 1, 16, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_FolhaObra', 'CDU_Observacoes', 'Observacoes', 'Observacoes', 1, 17, NULL, '', NULL);
go

delete from dbo.stdtabelasvar where tabela = 'TDU_ItemFolhaObra';
delete from dbo.stdcamposvar where tabela = 'TDU_ItemFolhaObra';
insert into dbo.stdtabelasvar values('TDU_ItemFolhaObra', 'ERP');
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_Id', 'Id', 'Id', 1, 1, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_IdItem', 'IdItem', 'IdItem', 1, 2, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_Referencia', 'Referencia', 'Referencia', 1, 3, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_Descricao', 'Descricao', 'Descricao', 1, 4, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_Quantidade', 'Quantidade', 'Quantidade', 1, 5, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_ValorUnitario', 'ValorUnitario', 'ValorUnitario', 1, 6, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_ValorBase', 'ValorBase', 'ValorBase', 1, 7, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_PercentagemDesconto', 'PercentagemDesconto', 'PercentagemDesconto', 1, 8, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_ValorDesconto', 'ValorDesconto', 'ValorDesconto', 1, 9, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_ValorSemIva', 'ValorSemIva', 'ValorSemIva', 1, 10, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_PercentagemIva', 'PercentagemIva', 'PercentagemIva', 1, 11, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_ValorIva', 'ValorIva', 'ValorIva', 1, 12, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_ValorComIva', 'ValorComIva', 'ValorComIva', 1, 13, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_Factura', 'Factura', 'Factura', 1, 14, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_IdClienteFactura', 'IdClienteFactura', 'IdClienteFactura', 1, 15, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_NomeClienteFactura', 'NomeClienteFactura', 'NomeClienteFactura', 1, 16, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_Estado', 'Estado', 'Estado', 1, 17, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_Facturar', 'Facturar', 'Facturar', 1, 18, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_ItemFolhaObra', 'CDU_IdMecanico', 'IdMecanico', 'IdMecanico', 1, 19, NULL, 0, NULL);
go

delete from dbo.stdtabelasvar where tabela = 'TDU_Mecanico';
delete from dbo.stdcamposvar where tabela = 'TDU_Mecanico';
insert into dbo.stdtabelasvar values('TDU_Mecanico', 'ERP');
insert into dbo.stdcamposvar values('TDU_Mecanico', 'CDU_Id', 'ID', 'Id', 1, 1, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_Mecanico', 'CDU_Nome', 'Nome', 'Nome', 1, 2, NULL, '', NULL);
go

delete from dbo.stdtabelasvar where tabela = 'TDU_Veiculo';
delete from dbo.stdcamposvar where tabela = 'TDU_Veiculo';
insert into dbo.stdtabelasvar values('TDU_Veiculo', 'ERP');
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_Matricula', 'Matricula', 'Matricula', 1, 1, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_IdCliente', 'IdCliente', 'IdCliente', 1, 2, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_NomeCliente', 'NomeCliente', 'NomeCliente', 1, 3, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_Marca', 'Marca', 'Marca', 1, 4, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_Modelo', 'Modelo', 'Modelo', 1, 5, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_TipoViatura', 'TipoViatura', 'TipoViatura', 1, 6, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_CavalosPotencia', 'CavalosPotencia', 'CavalosPotencia', 1, 7, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_Cilindrada', 'Cilindrada', 'Cilindrada', 1, 8, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_TipoCombustivel', 'TipoCombustivel', 'TipoCombustivel', 1, 9, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_NumeroChassis', 'NumeroChassis', 'NumeroChassis', 1, 10, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_NumeroMotor', 'NumeroMotor', 'NumeroMotor', 1, 11, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_MedidaPneus', 'MedidaPneus', 'MedidaPneus', 1, 12, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_DataFabrico', 'DataFabrico', 'DataFabrico', 1, 13, NULL, null, NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_DataMatricula', 'DataMatricula', 'DataMatricula', 1, 14, NULL, null, NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_Kms', 'Kms', 'Kms', 1, 15, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_KmsProximaRevisao', 'KmsProximaRevisao', 'KmsProximaRevisao', 1, 16, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_DataProximaRevisao', 'DataProximaRevisao', 'DataProximaRevisao', 1, 17, NULL, null, NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_DataInspeccao', 'DataInspeccao', 'DataInspeccao', 1, 18, NULL, null, NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_DataProximaInspeccao', 'DataProximaInspeccao', 'DataProximaInspeccao', 1, 19, NULL, null, NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_PaisOrigem', 'PaisOrigem', 'PaisOrigem', 1, 16, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_PesoEixoFrente', 'PesoEixoFrente', 'PesoEixoFrente', 1, 17, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_PesoEixoTras', 'PesoEixoTras', 'PesoEixoTras', 1, 18, NULL, 0, NULL);
insert into dbo.stdcamposvar values('TDU_Veiculo', 'CDU_Observacoes', 'Observacoes', 'Observacoes', 1, 19, NULL, '', NULL);
go

delete from dbo.stdtabelasvar where tabela = 'TDU_Pais';
delete from dbo.stdcamposvar where tabela = 'TDU_Pais';
insert into dbo.stdtabelasvar values('TDU_Pais', 'ERP');
insert into dbo.stdcamposvar values('TDU_Pais', 'CDU_Nome', 'Nome', 'Nome', 1, 1, NULL, '', NULL);
go

delete from dbo.stdtabelasvar where tabela = 'TDU_TipoVeiculo';
delete from dbo.stdcamposvar where tabela = 'TDU_TipoVeiculo';
insert into dbo.stdtabelasvar values('TDU_TipoVeiculo', 'ERP');
insert into dbo.stdcamposvar values('TDU_TipoVeiculo', 'CDU_Nome', 'Nome', 'Nome', 1, 1, NULL, '', NULL);
go

delete from dbo.stdtabelasvar where tabela = 'TDU_TipoCombustivel';
delete from dbo.stdcamposvar where tabela = 'TDU_TipoCombustivel';
insert into dbo.stdtabelasvar values('TDU_TipoCombustivel', 'ERP');
insert into dbo.stdcamposvar values('TDU_TipoCombustivel', 'CDU_Nome', 'Nome', 'Nome', 1, 1, NULL, '', NULL);
go

delete from dbo.stdtabelasvar where tabela = 'TDU_Relatorio';
delete from dbo.stdcamposvar where tabela = 'TDU_Relatorio';
insert into dbo.stdtabelasvar values('TDU_Relatorio', 'ERP');
insert into dbo.stdcamposvar values('TDU_Relatorio', 'CDU_Nome', 'Nome', 'Nome', 1, 1, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_Relatorio', 'CDU_Ficheiro', 'Ficheiro', 'Ficheiro', 1, 2, NULL, '', NULL);
go

delete from dbo.stdtabelasvar where tabela = 'TDU_ListaLayout';
delete from dbo.stdcamposvar where tabela = 'TDU_ListaLayout';
insert into dbo.stdtabelasvar values('TDU_ListaLayout', 'ERP');
insert into dbo.stdcamposvar values('TDU_ListaLayout', 'CDU_Lista', 'Lista', 'Lista', 1, 1, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_ListaLayout', 'CDU_Nome', 'Nome', 'Nome', 1, 2, NULL, '', NULL);
insert into dbo.stdcamposvar values('TDU_ListaLayout', 'CDU_XmlLayout', 'XmlLayout', 'XmlLayout', 1, 3, NULL, '', NULL);
go